//pages/home/index.js
import { View } from '@tarojs/components'
import Taro, { Component } from '@tarojs/taro'
import {ChooseImage} from '@/components/'
import http from '@/api'
class Home extends Component {
  
  constructor() {
    super(...arguments);
    this.state = ({
      chooseImg: {
        files: [],
        showUploadBtn:true,
        upLoadImg:[]
      },
      files:[],
    })
  }

  config = {
    navigationBarTitleText: '首页'
  }

  componentWillMount() {
  }
  
  // 拿到子组件上传图片的路径数组
  getOnFilesValue = (value) => {
    console.log(value);
    this.setState({
      files: value
    },() => {
      console.log(this.state.files)
    })

  }
  render() {
    return (
      <View className="home">
        <ChooseImage chooseImg = {this.state.chooseImg} onFilesValue={this.getOnFilesValue.bind(this)}/>
      </View>

    )
  }
}

export default Home